namespace Tekdev.Cryptography
{
	using System;
	using System.Text;
	using System.IO;
	
	internal class RSAUtilties
	{
		internal static void WriteKeyFile(string expression, string keyLocation)
		{
			using (FileStream fs = new FileStream(keyLocation, FileMode.Create))
			{                
				StreamWriter writer = new StreamWriter(fs);
				writer.Write(expression);
				writer.Close();
			}

			return;
		}

		internal static string ReadKeyFile(string keyLocation)
		{
			string keyValue = string.Empty;
			using (FileStream keyStream = File.Open(keyLocation, FileMode.Open))
			{
				StreamReader reader = new StreamReader(keyStream);
				keyValue = reader.ReadToEnd();
				reader.Close();
			}

			return keyValue;
		}
	}
}
